#!/usr/bin/perl -w
use strict;
use Getopt::Long;

#88888888888888888888888888888888888888888888888888888888888888888888888888888888

#	Usage

#88888888888888888888888888888888888888888888888888888888888888888888888888888888

my $cmd = <<"Bourne ShellCMD";
	test_open_stream_name_with_substitions
		-p "[PATH][SPECIESA].funny.haha.[FILENAME].oops.[SPECIESB][EXT]"
		-c "[SPECIESA],dog"
		-c "[SPECIESB],human"
		test/unit_test.pl
Bourne ShellCMD

sub prepare_cmd
{
	#remove beginning white space and new lines
	$_[0] =~tr/\t\n/ /d;
	$_[0] =~ s/\s+/ /gm;
	if ($_[1])
	{
		print STDERR $_[0], "\n";
	}
}

sub run_cmd
{
	prepare_cmd(@_);
	return `$_[0]`;
}


my $result = run_cmd($cmd);
if ($result ne "test/dog.funny.haha.unit_test.oops.human.pl\n")
{
	print STDERR "FAILED\n";
}
else
{
	print STDERR "SUCCESS!!!\n";
}
